import axios from '@/utils/http'

// 分页请求预约管理信息 ok
const findAppointmentList = "/appointment/management/findAppointmentList"
// 根据ID进行删除
const deleteAppointment = "/appointment/management/deleteAppointment"
// 根据条件查询预约管理信息
const getAppointmentQuery = "/appointment/management/getAppointmentQuery"
// 根据ID修改预约管理状态
const handleAppointment = "/appointment/management/handleAppointment"
// 根据ID创建一个新的预约单
const addAppointment = "/appointment/management/addAppointment"


// 根据分页查询预约设置信息
const findAppointmentUserList = "/appointment/setting/findAppointmentUserList"
// 根据传输的条件分页查询预约设置信息
const queryAppointmentUserList = "/appointment/setting/queryAppointmentUserList"
// 添加一条可预约人
const addAppointmentUser = "/appointment/setting/addAppointmentUser"
// 更新一条预约设置
const updateAppointmentUser = "/appointment/setting/updateAppointmentUser"
//  根据ID删除某一条预约信息
const deleteAppointmentUser = "/appointment/setting/deleteAppointmentUser"


// 展示所有患者信息
const findPatientList = "/Patient/management/findPatientList"
// 通过名字查询患者信息
const findPatientByName = "/Patient/management/findPatientByName"
// 通过患者ID查询信息
const getPatientById = "/Patient/management/getPatientById"

//显示所有用户信息
const findUserList = "/userManagement/user/findUserList"
//根据用户真实名称模糊查询
const findUserByName = "/userManagement/user/findUserByName"
//根据id查询用户信息
const findUserById = "/userManagement/user/findUserById"



const appointment = {
    findAppointmentList(data){
        return axios.post(findAppointmentList,data)
    },
    deleteAppointment(params){
        return axios.post(deleteAppointment+"?id="+params)
    },
    // getAppointmentQuery(pageSize,pageNum,query){
    //     return axios({
    //         method:'post',
    //         url:getAppointmentQuery,
    //         data:{
    //             pageSize: pageSize ,
    //             pageNum:  pageNum ,
    //             query:  query,
    //         },
    //         // headers:{
    //         //     'Content-Type':'application/json;charset=utf-8'
    //         // }
    //     })
    // },
    getAppointmentQuery(params){
        return axios.post(getAppointmentQuery,params)
    },
    handleAppointment(params){
        return axios.post(handleAppointment+"?id=" +params)
    },
    addAppointment(patientId,days){
        return axios.post(addAppointment+"?patientId="+patientId + "&days=" + days)
    },
    findAppointmentUserList(params){
        return axios.post(findAppointmentUserList,{params})
    },
    queryAppointmentUserList(params){
        return axios.post(queryAppointmentUserList,params)
    },
    addAppointmentUser(params){
        return axios.post(addAppointmentUser,params)
    },
    updateAppointmentUser(params){
        return axios.post(updateAppointmentUser,params)
    },
    deleteAppointmentUser(params){
        return axios.post(deleteAppointmentUser+"?id="+params)
    },
    findPatientList(params){
        return axios.get(findPatientList,{params})
    },
    findPatientByName(name,currentPage,pageSize){
        return axios.post(findPatientByName+"?name="+name + "&currentPage=" + currentPage + "&pageSize=" + pageSize)
    },
    getPatientById(params){
        return axios.get(getPatientById,{params})
    },
    findUserList(params){
        return axios.get(findUserList,{params})
    },
    findUserByName(params){
        return axios.get(findUserByName,{params})
    },
    findUserById(params){
        return axios.get(findUserById,{params})
    }
}

export default appointment